import Vue from 'vue'
import Vuex from 'vuex'
import map from './modules/map'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    mapData: null,
    speciesSelect:'huizong'
  },
  getters: {
  },
  mutations: {
    // 修改状态的函数
    setMapData(state, data) {
      state.mapData = data;
    },
    updateSpeciesSelect(state, newValue) {
      state.speciesSelect = newValue;
    },
  },
  actions: {
    updateVariable({ commit }, newValue) {
      commit('updateSpeciesSelect', newValue)
    }
  },
  modules: {
    map
  }
}) 